{
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.6"
  },
  "orig_nbformat": 4,
  "kernelspec": {
   "name": "python3",
   "display_name": "Python 3.9.6 64-bit ('.venv': venv)"
  },
  "interpreter": {
   "hash": "57c8a315c6c23d7b0c847d9e161f39b9acdb47ac46515144f7de32cc3ed177ea"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2,
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 10,
   "source": [
    "import pymysql\r\n",
    "\r\n",
    "connet = pymysql.connect(host='192.168.0.14',port=3306,user='junfeng',passwd='Gzjunfeng888!',db='jf_python_db')\r\n",
    "cur = connet.cursor()\r\n",
    "sql = 'insert into jf_data_all_backup(id,number,data) VALUES(null,%s,%s)'\r\n",
    "value = (\"504\", \"2021/8/4\")\r\n",
    "cur.execute(sql, value)\r\n",
    "connet.commit()"
   ],
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "metadata": {},
     "execution_count": 10
    }
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "source": [
    "import datetime\r\n",
    "date = ((datetime.datetime.now()-datetime.timedelta(days=1)).strftime(\"%Y/%m/%d\"))\r\n",
    "date"
   ],
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "'2021/08/02'"
      ]
     },
     "metadata": {},
     "execution_count": 15
    }
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "source": [
    "for i in range(2,-1,-1):\r\n",
    "    print(i)"
   ],
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "2\n",
      "1\n",
      "0\n"
     ]
    }
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "source": [
    "datetime.datetime.now().strftime(\"%Y/%m/%d\")\r\n",
    "type(datetime.datetime.now().strftime(\"%Y/%m/%d\"))"
   ],
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "str"
      ]
     },
     "metadata": {},
     "execution_count": 18
    }
   ],
   "metadata": {}
  }
 ]
}